﻿<UserControl x:Class="CBR.Views.TwoPageView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"
			 Background="{DynamicResource CbrDarkBackgroundBrush}"
			 xmlns:Controls="clr-namespace:CBR.Components.Controls">

	<Grid Name="PageViewerGrid">
		<Controls:TwoPageBook x:Name="PageViewer"
							  ItemsSource="{Binding Pages}"
							  CurrentPageIndex="{Binding CurrentPageIndex, Mode=TwoWay}"
							  Scale="{Binding Scale, Mode=TwoWay}"
							  FitMode="{Binding FitMode}"
							  PreviewMouseMove="PageViewer_PreviewMouseMove"
							  PreviewMouseLeftButtonDown="PageViewer_PreviewMouseLeftButtonDown"
							  PreviewMouseLeftButtonUp="PageViewer_PreviewMouseLeftButtonUp"
							  PreviewKeyDown="PageViewer_PreviewKeyDown"
							  PreviewKeyUp="PageViewer_PreviewKeyUp">
			<Controls:TwoPageBook.ItemTemplate>
				<DataTemplate>
					<Image Source="{Binding Image}" Stretch="Uniform" />
				</DataTemplate>
			</Controls:TwoPageBook.ItemTemplate>
		</Controls:TwoPageBook>

		<Controls:MagnifyGlass x:Name="Magnifier" Panel.ZIndex="500" VisualToDisplay="{Binding ElementName=PageViewer}" 
                               Scale="{Binding MagnifierSize}" Zoom="{Binding MagnifierScale}" />
	</Grid>
</UserControl>
